package com.netease.stat;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Build.VERSION;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowManager;
import com.netease.framework.b.c;
import com.netease.framework.b.d;
import com.netease.framework.m;
import com.netease.pris.a.t;
import com.netease.pris.a.u;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Set;
import org.json.JSONException;
import org.json.JSONObject;

public class a
  implements d
{
  private static final boolean D = false;
  private static final String E = "StatisticService";
  private static String F = null;
  private static final String G = "xmid";
  private static final String H = "firstEventAccount";
  private static final String I = "client";
  private static final String J = "ver";
  private static final String K = "client_id";
  private static final String L = "mobile";
  private static final String M = "os";
  private static final String N = "os_ver";
  private static final String O = "product_ver";
  private static final String P = "scr_res";
  private static final String Q = "reportTime";
  private static final String R = "product";
  private static final String S = "protocolVersion";
  private static final String T = "launch";
  private static final String U = "switch";
  private static final String V = "login";
  private static final String W = "exit";
  private static final String X = "logout";
  private static final String Y = "open";
  private static final String Z = "switch";
  public static final String a = "http://analytics.hz.netease.com:8084/locate";
  private static final String aA = "errorMessage";
  private static final String aB = "back";
  private static final String aC = "front";
  private static final String aD = "Error";
  private static final String aE = "Logout";
  private static final String aF = "cmcc";
  private static final String aG = "Unicom";
  private static final String aH = "chinatelecom";
  private static final String aI = "WCDMA";
  private static final String aJ = "GPRS";
  private static final String aK = "CDMA2000";
  private static final String aL = "TD-SCDMA";
  private static final String aM = "CDMA";
  private static final String aN = "WIFI";
  private static final String aO = "WLAN";
  private static final int aP = 1800000;
  private static final String aQ = "1.8.0";
  private static final int aR = 4096;
  private static boolean aS = false;
  private static a aT;
  private static final String aa = "install";
  private static final String ab = "uninstall";
  private static final String ac = "Softupgrade";
  private static final String ad = "autoupdate";
  private static final String ae = "heartbeat";
  private static final String af = "Pagevisit";
  private static final String ag = "error";
  private static final String ah = "method";
  private static final String ai = "opTime";
  private static final String aj = "costTime";
  private static final String ak = "record";
  private static final String al = "mode";
  private static final String am = "ip";
  private static final String an = "account";
  private static final String ao = "mno";
  private static final String ap = "network";
  private static final String aq = "type";
  private static final String ar = "options";
  private static final String as = "reason";
  private static final String at = "update_ver";
  private static final String au = "old_ver";
  private static final String av = "way";
  private static final String aw = "curpage";
  private static final String ax = "gopage";
  private static final String ay = "ref";
  private static final String az = "errorCode";
  public static final String b = "events";
  public static final String c = "RPMMS";
  public static final String d = "PRIS";
  public static final String e = "NBA";
  public static final String f = "MBlog";
  public static final String g = "Blog";
  public static final String h = "SMSAssistant";
  public static final String i = "ContactAssistant";
  public static final String j = "CloudAlbum";
  boolean A;
  PendingIntent B;
  b C;
  Object[] k = new Object[0];
  c l = m.a().c();
  HashMap m = new HashMap();
  LinkedList n = new LinkedList();
  int o;
  Context p;
  String q;
  String r;
  String s;
  String t;
  String u;
  String v;
  String w;
  String x;
  boolean y;
  boolean z;

  public static String a()
  {
    return F;
  }

  // ERROR //
  private static String a(Context paramContext)
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aload_0
    //   3: invokestatic 297	com/netease/stat/a:b	(Landroid/content/Context;)Ljava/lang/String;
    //   6: astore 4
    //   8: aload 4
    //   10: astore_3
    //   11: aload_3
    //   12: invokestatic 303	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   15: ifeq +12 -> 27
    //   18: aload_0
    //   19: invokestatic 305	com/netease/stat/a:c	(Landroid/content/Context;)Ljava/lang/String;
    //   22: astore 6
    //   24: aload 6
    //   26: astore_3
    //   27: aload_3
    //   28: ifnonnull +7 -> 35
    //   31: ldc_w 307
    //   34: astore_3
    //   35: aload_3
    //   36: areturn
    //   37: astore_2
    //   38: aload_2
    //   39: invokevirtual 310	java/lang/Exception:printStackTrace	()V
    //   42: aload_1
    //   43: astore_3
    //   44: goto -17 -> 27
    //   47: astore 5
    //   49: aload_3
    //   50: astore_1
    //   51: aload 5
    //   53: astore_2
    //   54: goto -16 -> 38
    //
    // Exception table:
    //   from	to	target	type
    //   2	8	37	java/lang/Exception
    //   11	24	47	java/lang/Exception
  }

  public static void a(int paramInt, String paramString)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("errorCode", paramInt);
      localJSONObject.put("errorMessage", paramString);
      f().a(localJSONObject, "error", -1L);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(long paramLong)
  {
    f().a(null, "launch", paramLong);
  }

  public static void a(long paramLong, String paramString)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      String str1 = l();
      if (str1 != null)
        localJSONObject.put("ip", str1);
      String str2 = f(f().p);
      if (str2 != null)
        localJSONObject.put("mno", str2);
      String str3 = g(f().p);
      if (str3 != null)
        localJSONObject.put("network", str3);
      localJSONObject.put("account", paramString);
      c();
      f().s = paramString;
      f().a(localJSONObject, "login", paramLong);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(long paramLong, String paramString1, String paramString2)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("update_ver", paramString1);
      localJSONObject.put("old_ver", paramString2);
      f().a(localJSONObject, "autoupdate", paramLong);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(long paramLong, String paramString1, String paramString2, String paramString3)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("update_ver", paramString1);
      localJSONObject.put("old_ver", paramString2);
      localJSONObject.put("way", paramString3);
      f().a(localJSONObject, "Softupgrade", paramLong);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(long paramLong, boolean paramBoolean)
  {
    JSONObject localJSONObject = new JSONObject();
    if (paramBoolean);
    try
    {
      localJSONObject.put("mode", "back");
      while (true)
      {
        f().a(localJSONObject, "switch", paramLong);
        return;
        localJSONObject.put("mode", "front");
      }
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(Context paramContext, b paramb, String paramString1, String paramString2, String paramString3, String paramString4)
  {
    a locala = f();
    if (!locala.y)
    {
      locala.p = paramContext;
      locala.q = paramContext.getPackageName();
      locala.r = paramString1;
      locala.s = paramString2;
      locala.t = paramString3;
      locala.u = paramString4;
      locala.v = d(paramContext);
      locala.w = a(paramContext);
      locala.x = e(paramContext);
      locala.y = true;
      locala.a(paramb);
    }
  }

  private void a(b paramb)
  {
    this.C = paramb;
    if (paramb != null)
      F = paramb.a();
    if (this.l != null)
    {
      com.netease.stat.a.a locala = com.netease.stat.a.a.a(this.q, p(), aS);
      this.l.a(locala);
    }
  }

  public static void a(String paramString)
  {
    F = paramString;
    a locala = f();
    if ((locala != null) && (locala.C != null))
      locala.C.a(paramString);
  }

  public static void a(String paramString, long paramLong1, long paramLong2)
  {
    f().a(null, paramString, paramLong1, paramLong2);
  }

  public static void a(String paramString, long paramLong1, long paramLong2, HashMap paramHashMap)
  {
    JSONObject localJSONObject = new JSONObject();
    if (paramHashMap != null)
      try
      {
        Iterator localIterator = paramHashMap.entrySet().iterator();
        while (localIterator.hasNext())
        {
          Map.Entry localEntry = (Map.Entry)localIterator.next();
          localJSONObject.put((String)localEntry.getKey(), localEntry.getValue());
        }
      }
      catch (JSONException localJSONException)
      {
        localJSONException.printStackTrace();
      }
    f().a(localJSONObject, paramString, paramLong1, paramLong2);
  }

  public static void a(String paramString1, String paramString2)
  {
    JSONObject localJSONObject = new JSONObject();
    if (paramString1 != null);
    try
    {
      localJSONObject.put("options", paramString1);
      if (paramString2 != null)
        localJSONObject.put("reason", paramString2);
      f().a(localJSONObject, "uninstall", -1L);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(String paramString1, String paramString2, String paramString3)
  {
    JSONObject localJSONObject = new JSONObject();
    if (paramString1 != null);
    try
    {
      localJSONObject.put("curpage", paramString1);
      localJSONObject.put("gopage", paramString2);
      if (paramString3 != null)
        localJSONObject.put("ref", paramString3);
      f().a(localJSONObject, "Pagevisit", -1L);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(String paramString1, String paramString2, HashMap paramHashMap)
  {
    if ((paramString1 == null) || (paramString2 == null));
    while (true)
    {
      return;
      Long localLong = (Long)f().m.remove(paramString1 + "_" + paramString2);
      if (localLong == null)
        continue;
      long l1 = o() - localLong.longValue();
      JSONObject localJSONObject = new JSONObject();
      if (paramHashMap != null)
        try
        {
          Iterator localIterator = paramHashMap.entrySet().iterator();
          while (localIterator.hasNext())
          {
            Map.Entry localEntry = (Map.Entry)localIterator.next();
            localJSONObject.put((String)localEntry.getKey(), localEntry.getValue());
          }
        }
        catch (JSONException localJSONException)
        {
          localJSONException.printStackTrace();
        }
      f().a(localJSONObject, paramString1, l1);
    }
  }

  public static void a(String paramString, JSONObject paramJSONObject)
  {
    f().a(paramJSONObject, paramString, o(), -1L);
  }

  private void a(JSONObject paramJSONObject)
  {
    if (!this.y)
      return;
    String str = paramJSONObject.toString();
    while (true)
    {
      synchronized (this.k)
      {
        this.o += str.length();
        this.n.add(str);
        if (this.o >= 4096)
        {
          i1 = 1;
          if (i1 == 0)
            break;
          d(false);
        }
      }
      int i1 = 0;
    }
  }

  private void a(JSONObject paramJSONObject, String paramString, long paramLong)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("method", paramString);
      localJSONObject.put("opTime", o());
      if (paramLong > 0L)
        localJSONObject.put("costTime", paramLong);
      if (paramJSONObject != null)
        localJSONObject.put("record", paramJSONObject);
      a(localJSONObject);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  private void a(JSONObject paramJSONObject, String paramString, long paramLong1, long paramLong2)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("method", paramString);
      localJSONObject.put("opTime", paramLong1);
      if (paramLong2 > 0L)
        localJSONObject.put("costTime", paramLong2);
      if (paramJSONObject != null)
        localJSONObject.put("record", paramJSONObject);
      a(localJSONObject);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static void a(boolean paramBoolean)
  {
    aS = paramBoolean;
  }

  private static String b(Context paramContext)
  {
    return ((TelephonyManager)paramContext.getSystemService("phone")).getDeviceId();
  }

  public static void b()
  {
    a locala = aT;
    aT = null;
    if (locala != null)
    {
      locala.y = false;
      locala.h();
      locala.p = null;
    }
  }

  public static void b(long paramLong)
  {
    f().a(null, "logout", paramLong);
  }

  public static void b(String paramString)
  {
    f().d(true);
    f().s = paramString;
  }

  public static void b(String paramString1, String paramString2)
  {
    if ((paramString1 == null) || (paramString2 == null));
    while (true)
    {
      return;
      f().m.put(paramString1 + "_" + paramString2, Long.valueOf(o()));
    }
  }

  public static void b(boolean paramBoolean)
  {
    JSONObject localJSONObject = new JSONObject();
    if (paramBoolean);
    try
    {
      localJSONObject.put("type", "Error");
      while (true)
      {
        f().a(localJSONObject, "exit", -1L);
        f().d(true);
        return;
        localJSONObject.put("type", "Logout");
      }
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  private static String c(Context paramContext)
  {
    return ((WifiManager)paramContext.getSystemService("wifi")).getConnectionInfo().getMacAddress();
  }

  public static void c()
  {
    f().d(false);
  }

  public static void c(long paramLong)
  {
    f().a(null, "switch", paramLong);
  }

  public static void c(String paramString)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      String str1 = l();
      if (str1 != null)
        localJSONObject.put("ip", str1);
      String str2 = f(f().p);
      if (str2 != null)
        localJSONObject.put("mno", str2);
      String str3 = g(f().p);
      if (str3 != null)
        localJSONObject.put("network", str3);
      if (paramString != null)
        localJSONObject.put("account", paramString);
      f().a(localJSONObject, "open", -1L);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  public static boolean c(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      Context localContext = f().p;
      if (localContext != null)
      {
        t localt = u.c(localContext);
        if ((localt != t.d) && (localt != t.c));
      }
    }
    for (int i1 = 0; ; i1 = 1)
      return i1;
  }

  // ERROR //
  private static String d(Context paramContext)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 539	android/content/Context:getPackageManager	()Landroid/content/pm/PackageManager;
    //   4: aload_0
    //   5: invokevirtual 357	android/content/Context:getPackageName	()Ljava/lang/String;
    //   8: iconst_0
    //   9: invokevirtual 545	android/content/pm/PackageManager:getPackageInfo	(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
    //   12: getfield 550	android/content/pm/PackageInfo:versionName	Ljava/lang/String;
    //   15: astore_2
    //   16: aload_2
    //   17: ifnull +28 -> 45
    //   20: aload_2
    //   21: bipush 32
    //   23: invokevirtual 554	java/lang/String:indexOf	(I)I
    //   26: istore 4
    //   28: iload 4
    //   30: ifle +15 -> 45
    //   33: aload_2
    //   34: iconst_0
    //   35: iload 4
    //   37: invokevirtual 558	java/lang/String:substring	(II)Ljava/lang/String;
    //   40: astore 5
    //   42: aload 5
    //   44: astore_2
    //   45: aload_2
    //   46: areturn
    //   47: astore_1
    //   48: ldc_w 307
    //   51: astore_2
    //   52: aload_1
    //   53: astore_3
    //   54: aload_3
    //   55: invokevirtual 559	android/content/pm/PackageManager$NameNotFoundException:printStackTrace	()V
    //   58: goto -13 -> 45
    //   61: astore_3
    //   62: goto -8 -> 54
    //
    // Exception table:
    //   from	to	target	type
    //   0	16	47	android/content/pm/PackageManager$NameNotFoundException
    //   20	42	61	android/content/pm/PackageManager$NameNotFoundException
  }

  public static void d()
  {
    f().q();
  }

  public static void d(String paramString)
  {
    JSONObject localJSONObject = new JSONObject();
    if (paramString != null);
    try
    {
      localJSONObject.put("options", paramString);
      f().a(localJSONObject, "install", -1L);
      return;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  // ERROR //
  private void d(boolean paramBoolean)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 352	com/netease/stat/a:y	Z
    //   4: ifne +4 -> 8
    //   7: return
    //   8: aload_0
    //   9: invokespecial 389	com/netease/stat/a:p	()Lorg/json/JSONObject;
    //   12: astore_2
    //   13: new 288	java/util/LinkedList
    //   16: dup
    //   17: invokespecial 289	java/util/LinkedList:<init>	()V
    //   20: astore_3
    //   21: aconst_null
    //   22: astore 4
    //   24: aload_0
    //   25: getfield 271	com/netease/stat/a:k	[Ljava/lang/Object;
    //   28: astore 5
    //   30: aload 5
    //   32: monitorenter
    //   33: aload_0
    //   34: getfield 291	com/netease/stat/a:n	Ljava/util/LinkedList;
    //   37: invokevirtual 564	java/util/LinkedList:size	()I
    //   40: ifne +17 -> 57
    //   43: aload 5
    //   45: monitorexit
    //   46: goto -39 -> 7
    //   49: astore 6
    //   51: aload 5
    //   53: monitorexit
    //   54: aload 6
    //   56: athrow
    //   57: aload_0
    //   58: getfield 566	com/netease/stat/a:A	Z
    //   61: ifeq +63 -> 124
    //   64: aload_0
    //   65: iconst_1
    //   66: putfield 568	com/netease/stat/a:z	Z
    //   69: aload 5
    //   71: monitorexit
    //   72: aload_3
    //   73: invokevirtual 564	java/util/LinkedList:size	()I
    //   76: ifle +18 -> 94
    //   79: aload_0
    //   80: getfield 359	com/netease/stat/a:q	Ljava/lang/String;
    //   83: aload_2
    //   84: aload_3
    //   85: iload_1
    //   86: getstatic 266	com/netease/stat/a:aS	Z
    //   89: invokestatic 571	com/netease/stat/a/a:b	(Ljava/lang/String;Lorg/json/JSONObject;Ljava/util/LinkedList;ZZ)Lcom/netease/stat/a/a;
    //   92: astore 4
    //   94: aload 4
    //   96: ifnull -89 -> 7
    //   99: aload_0
    //   100: getfield 281	com/netease/stat/a:l	Lcom/netease/framework/b/c;
    //   103: ifnull -96 -> 7
    //   106: aload 4
    //   108: aload_0
    //   109: invokevirtual 576	com/netease/framework/b/e:a	(Lcom/netease/framework/b/d;)V
    //   112: aload_0
    //   113: getfield 281	com/netease/stat/a:l	Lcom/netease/framework/b/c;
    //   116: aload 4
    //   118: invokevirtual 399	com/netease/framework/b/c:a	(Lcom/netease/framework/b/e;)V
    //   121: goto -114 -> 7
    //   124: aload_3
    //   125: aload_0
    //   126: getfield 291	com/netease/stat/a:n	Ljava/util/LinkedList;
    //   129: invokevirtual 580	java/util/LinkedList:addAll	(Ljava/util/Collection;)Z
    //   132: pop
    //   133: aload_0
    //   134: getfield 291	com/netease/stat/a:n	Ljava/util/LinkedList;
    //   137: invokevirtual 583	java/util/LinkedList:clear	()V
    //   140: aload_0
    //   141: iconst_0
    //   142: putfield 469	com/netease/stat/a:o	I
    //   145: goto -76 -> 69
    //
    // Exception table:
    //   from	to	target	type
    //   33	54	49	finally
    //   57	72	49	finally
    //   124	145	49	finally
  }

  private static String e(Context paramContext)
  {
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    ((WindowManager)paramContext.getSystemService("window")).getDefaultDisplay().getMetrics(localDisplayMetrics);
    if (i() >= 5);
    for (String str = localDisplayMetrics.heightPixels + "*" + localDisplayMetrics.widthPixels; ; str = (int)(localDisplayMetrics.heightPixels / localDisplayMetrics.density) + "*" + (int)(localDisplayMetrics.widthPixels / localDisplayMetrics.density))
      return str;
  }

  protected static void e()
  {
    f().a(null, "heartbeat", -1L);
    c();
  }

  public static void e(String paramString)
  {
    a(paramString, o(), -1L);
  }

  private static a f()
  {
    if (aT == null)
      aT = new a();
    return aT;
  }

  private static String f(Context paramContext)
  {
    String str2;
    if (paramContext == null)
      str2 = null;
    while (true)
    {
      return str2;
      String str1 = ((TelephonyManager)paramContext.getSystemService("phone")).getSubscriberId();
      if (str1 != null)
      {
        if ((str1.startsWith("46000")) || (str1.startsWith("46002")))
        {
          str2 = "cmcc";
          continue;
        }
        if (str1.startsWith("46001"))
        {
          str2 = "Unicom";
          continue;
        }
        if (str1.startsWith("46003"))
        {
          str2 = "chinatelecom";
          continue;
        }
        str2 = "unknown";
        continue;
      }
      str2 = null;
    }
  }

  private static String g(Context paramContext)
  {
    String str;
    if (paramContext == null)
      str = null;
    while (true)
    {
      return str;
      ConnectivityManager localConnectivityManager = (ConnectivityManager)paramContext.getSystemService("connectivity");
      if (localConnectivityManager == null)
      {
        str = null;
        continue;
      }
      NetworkInfo[] arrayOfNetworkInfo = localConnectivityManager.getAllNetworkInfo();
      if (arrayOfNetworkInfo != null)
      {
        int i1 = 0;
        if (i1 < arrayOfNetworkInfo.length)
        {
          if (arrayOfNetworkInfo[i1] == null);
          do
          {
            i1++;
            break;
          }
          while ((!arrayOfNetworkInfo[i1].isAvailable()) || (!arrayOfNetworkInfo[i1].isConnectedOrConnecting()));
          if (arrayOfNetworkInfo[i1].getType() == 1)
          {
            str = "WIFI";
            continue;
          }
          if (arrayOfNetworkInfo[i1].getType() == 0)
          {
            str = "GPRS";
            continue;
          }
          str = "unknown";
          continue;
        }
      }
      str = null;
    }
  }

  private void g()
  {
    h();
    if (this.p != null)
    {
      Intent localIntent = new Intent(this.p, HeartBeatAlarm.class);
      this.B = PendingIntent.getBroadcast(this.p, 0, localIntent, 0);
      ((AlarmManager)this.p.getSystemService("alarm")).setRepeating(0, 1800000L + System.currentTimeMillis(), 1800000L, this.B);
    }
  }

  private void h()
  {
    if ((this.p != null) && (this.B != null))
    {
      ((AlarmManager)this.p.getSystemService("alarm")).cancel(this.B);
      this.B = null;
    }
  }

  private static int i()
  {
    try
    {
      int i2 = Integer.valueOf(Build.VERSION.SDK).intValue();
      i1 = i2;
      return i1;
    }
    catch (NumberFormatException localNumberFormatException)
    {
      while (true)
        int i1 = 5;
    }
  }

  private static String j()
  {
    return Build.VERSION.RELEASE;
  }

  private static String k()
  {
    switch (i())
    {
    default:
    case 6:
    }
    for (String str = j(); ; str = "2.0Later")
      return str;
  }

  private static String l()
  {
    try
    {
      Enumeration localEnumeration1 = NetworkInterface.getNetworkInterfaces();
      if (localEnumeration1 != null)
      {
        InetAddress localInetAddress;
        do
        {
          Enumeration localEnumeration2;
          while (!localEnumeration2.hasMoreElements())
          {
            if (!localEnumeration1.hasMoreElements())
              break;
            localEnumeration2 = ((NetworkInterface)localEnumeration1.nextElement()).getInetAddresses();
          }
          localInetAddress = (InetAddress)localEnumeration2.nextElement();
        }
        while ((localInetAddress == null) || (localInetAddress.isLoopbackAddress()));
        String str2 = localInetAddress.getHostAddress();
        str1 = str2;
        return str1;
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        localException.printStackTrace();
        String str1 = null;
      }
    }
  }

  private static String m()
  {
    return Build.MODEL;
  }

  private static String n()
  {
    return String.valueOf(Build.VERSION.SDK_INT);
  }

  private static long o()
  {
    return System.currentTimeMillis();
  }

  private JSONObject p()
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("protocolVersion", "1.8.0");
      localJSONObject.put("xmid", this.r);
      if (!TextUtils.isEmpty(this.s))
        localJSONObject.put("firstEventAccount", this.s);
      localJSONObject.put("client", m());
      localJSONObject.put("ver", n());
      localJSONObject.put("client_id", this.w);
      if (!TextUtils.isEmpty(this.t))
        localJSONObject.put("mobile", this.t);
      localJSONObject.put("os", "Android");
      localJSONObject.put("os_ver", k());
      localJSONObject.put("product_ver", this.v);
      localJSONObject.put("scr_res", this.x);
      localJSONObject.put("reportTime", o());
      localJSONObject.put("product", this.u);
      return localJSONObject;
    }
    catch (JSONException localJSONException)
    {
      while (true)
        localJSONException.printStackTrace();
    }
  }

  private void q()
  {
    if (!this.y);
    while (true)
    {
      return;
      LinkedList localLinkedList = new LinkedList();
      JSONObject localJSONObject = p();
      synchronized (this.k)
      {
        if (this.n.size() > 0)
        {
          localLinkedList.addAll(this.n);
          this.n.clear();
        }
        com.netease.stat.a.a.a(this.q, localJSONObject, localLinkedList);
      }
    }
  }

  private void r()
  {
    while (true)
    {
      synchronized (this.k)
      {
        this.A = false;
        if (this.z)
        {
          this.z = false;
          i1 = 1;
          if (i1 == 0)
            continue;
          d(false);
          return;
        }
      }
      int i1 = 0;
    }
  }

  public void a(int paramInt1, int paramInt2, int paramInt3, Object paramObject)
  {
    r();
  }

  public void b(int paramInt1, int paramInt2, int paramInt3, Object paramObject)
  {
    r();
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.stat.a
 * JD-Core Version:    0.6.0
 */